<template> 
	<view class="perfectbox" v-if="show != 2" :style="{height: show == 0 ? 0 : '100%'} ">
		<u-mask :show="show == 1" @click="ff_showx">
			<view class="warp">
				<view class="rect" @tap.stop>
					<view class="rect_image">
						<image @click="ff_showx" src="https://z3.ax1x.com/2021/08/28/h1IAiD.png"></image>
					</view>
					<view class="rect_content">
						<image src="https://z3.ax1x.com/2021/08/28/h1IEJe.png"></image>
						<view class="rect_text">完善个人信息</view>
						<view class="rect_text">即可解锁所有模块哦～</view>
						<view class="rect_perfect" @click="goPerfect">完善信息</view>
					</view>
				</view>
			</view>
		</u-mask>
		<u-mask :show="show == 0" @click="ff_showx" >
			<view class="warp">
				<view class="rect" @tap.stop>
					<view   class="rect_image" @click="ff_showx">
						
					</view>
					<image @click="goPerfect" class="neice" :src="img"></image>
					<!-- <view class="rectBox">
						<p>Holle.</p>
						<p>{{inviteCode}}号面粉</p>
					</view>
					<view class="rect_content">
						<view class="rect_contentBox">
							<view class="rect_contentBoxBodys">
								<view class="rect_contentBoxTop">欢迎参加内测</view>
								<view class="rect_contentBoxbott">
									<p>完善资料可获得</p>
									<p>吃喝玩乐大会</p>
								</view>
							</view>
							<image class="imgTitle" src="../../static/xiaonian.png" mode="widthFix"></image>
						</view>
					
						
					</view> -->
					<!-- <view class="rect_perfectx" @click="goPerfect">立即前往</view> -->
				</view>
			</view>
		</u-mask>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			}
		},

		props: ['show', 'pagepath','inviteCode','img','detail'],
		methods: {

			ff_showx() {
				// debugger
				this.$emit('ff_show');
			},
			goPerfect() {
				// 微信登陆
				console.log("微信登陆")
				uni.getUserProfile({
					lang: "zh_CN",
					desc: "登录",
					success: (res) => {
						console.log("登录res:", res)
						uni.setStorageSync("userInfo", res.userInfo)
						wx.login({
							provider: 'weixin',
							success: (loginRes) => {
								console.log("code，", loginRes.code)
								let data = {};
									uni.request({
									url: `${this.$config.url}/account/login`,
									data: {code: loginRes.code},
									method: "POST",
									success: requestRes => {
									// debugger
									if (this.userPhoneApi) {
										this.show = false
										uni.showToast({
											title: "登录成功"
										})
									} else {
										// debugger
										// uni.navigateTo({
										// 	url: "/pages/my/label/label?isLogin=1"
										// })
										uni.navigateTo({
											url: "/pages/my/setting/setting?isLogin=1"
										})
									}
									}
								});
								}
						})
					},
					fail: (res) => {
						console.log("res失败 ", res)
					}
				})
			}

		},

	}
</script>

<style lang="scss">
	.perfectbox {
		position: fixed;
		left: 0;
		top: 0;
		width: 100%;
		height: 100%;
		z-index: 99;

		/* 完善信息 */
		.warp {
			display: flex;
			align-items: center;
			justify-content: center;
			height: 100%;
		}
		.neice{
	
			width: 560rpx;
			height: 640rpx;
			opacity: 1;
		}
		
		.rectBox{
			    margin: 40rpx;
			p{
				font-size: 26rpx;
				font-family: Montserrat, Montserrat-Bold;
				font-weight: 700;
				text-align: LEFT;
				color: #040000;
			}
		}

		.rect {
			width: 550rpx;
			height: 550rpx;
			background-color: #fff;
			    border-radius: 12rpx;
				    position: relative;
		}

		.rectBox{
			color: #040000;
			p{
				font-size: 13px;
				font-family: Montserrat, Montserrat-Bold;
				font-weight: 700;
				text-align: LEFT;
				color: #040000;
			}
		}
		.rect_contentBox{
			    display: flex;
			    justify-content: space-around;
		}
		.rect_contentBoxBodys{
			color: #040000;
		}
		.rect_contentBoxTop{
			font-size: 40rpx;
			font-family: Source Han Sans CN, Source Han Sans CN-Bold;
			font-weight: 700;
			text-align: LEFT;
			color: #040000;
			  margin-top: 15rpx;
		}
		.imgTitle{
			width: 160rpx !important;
			height: 160rpx!important;
			margin: 0rpx!important;
			transform: translateY(10rpx);
		}
		.rect_contentBoxbott{
			margin-top: 30rpx;
			p:nth-child(1){
				font-size: 26rpx;
				font-family: Source Han Sans SC, Source Han Sans SC-Regular;
				font-weight: 400;
				text-align: LEFT;
				color: #606266;
				  
			}
			p:nth-child(2){
				font-size: 26rpx;
				font-family: Source Han Sans SC, Source Han Sans SC-Regular;
				font-weight: 400;
				text-align: LEFT;
				color:#f10200;
			}
		}

		.rect_image {
			// position: relative;
			width: 85rpx;
			height: 85rpx;
			position: absolute;
			right: 0rpx;
			top: 0rpx;
		}



		.rect_content {
			text-align: center;
		}

		.rect_content image {
			margin-top: 100rpx;
			width: 160rpx;
			height: 160rpx;
			margin-bottom: 30rpx;
		}

		.rect_text {
			font-size: 26rpx;
			color: #606266;
		}

		.rect_perfect {
			width: 470rpx;
			height: 84rpx;
			color: #FFFFFF;
			font-weight: 700;
			font-size: 32rpx;
			background: #f10200;
			border-radius: 6px;
			line-height: 84rpx;
			margin: 60rpx 0 0 40rpx;
			letter-spacing: 2rpx;
		}
		.rect_perfectx{
			width: 470rpx;
			height: 84rpx;
			color: #FFFFFF;
			font-weight: 700;
			font-size: 32rpx;
			background: #f10200;
			border-radius: 6px;
			line-height: 84rpx;
			text-align: center;
			    // margin: 120rpx 0 0 40rpx;
			letter-spacing: 2rpx;
			position: absolute;
			bottom: 200rpx;
		}
	}
</style>
